package com.fanwh.healthycampus2.activity;

import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.fanwh.healthycampus2.BuildConfig;
import com.fanwh.healthycampus2.R;

import me.drakeet.multitype.Items;
import me.drakeet.support.about.AbsAboutActivity;
import me.drakeet.support.about.Card;
import me.drakeet.support.about.Category;
import me.drakeet.support.about.Contributor;
import me.drakeet.support.about.License;

public class AboutActivity extends AbsAboutActivity {
    @Override
    protected void onCreateHeader(@NonNull ImageView icon, @NonNull TextView slogan, @NonNull TextView version) {
        icon.setImageResource(R.mipmap.ic_launcher_round);
        slogan.setText("健康重邮");
        version.setText("v " + BuildConfig.VERSION_NAME);
    }

    @Override
    protected void onItemsCreated(@NonNull Items items) {
        items.add(new Category("About and Help"));
        items.add(new Card(getString(R.string.about_introduce)));

        items.add(new Category("Developers"));
        items.add(new Contributor(R.mipmap.fanwh, "fanwh", "Developer & designer"));

        items.add(new Category("Open Source Licenses"));
        items.add(new License("AwesomeSplash", "ViksaaSkool", License.APACHE_2, "com.github.ViksaaSkool:AwesomeSplash:v1.0.0"));
        items.add(new License("bmob-sdk", "bmob", License.APACHE_2, "cn.bmob.android:bmob-sdk:3.7.8"));
        items.add(new License("About-page", "drakeet", License.APACHE_2, "https://github.com/drakeet/about-page"));
        items.add(new License("Dialogs", "afollestad", License.APACHE_2, "com.afollestad.material-dialogs:core:0.9.6.0"));
        items.add(new License("okhttp", "squareup", License.APACHE_2, "com.squareup.okhttp3:okhttp:3.14.1"));
        items.add(new License("okio", "squareup", License.APACHE_2, "com.squareup.okio:okio:2.2.2"));
        items.add(new License("glide", "bumptech", License.APACHE_2, "com.github.bumptech.glide:glide:3.7.0"));
        items.add(new License("glide-transformations", "wasabeef", License.APACHE_2, "jp.wasabeef:glide-transformations:2.0.1"));
        items.add(new License("RxJava", "reactivex", License.APACHE_2, "io.reactivex.rxjava2:rxjava:2.2.2"));
        items.add(new License("RxAndroid", "reactivex", License.APACHE_2, "io.reactivex.rxjava2:rxandroid:2.1.0"));
        items.add(new License("Gson", "google", License.APACHE_2, "com.google.code.gson:gson:2.8.5"));
    }
}
